public class Test {
    public static void main(String[] args) {
        Animal animal = new Dog("wangzai",4);
        if(animal instanceof Dog ){
            Dog dog = (Dog)animal;
            dog.bark();
        }else{
            System.out.println("Animal not instanceof Dog");
        }
        if(animal instanceof Cat) {
            Cat cat = (Cat) animal;
            cat.mew();
        }else{
            System.out.println("Animal not instanceof Cat");
        }
    }




    public static void main6(String[] args) {
        Crcle crcle = new Crcle();
        Rect rect = new Rect();
        Flower flower = new Flower();
        Shape[] shapes = {crcle, crcle, rect, flower};
        for (Shape shape : shapes) {
            shape.draw();
        }

    }

    public static void eatting(Animal animal){
        animal.eat();
    }
    public static void main5(String[] args) {
        eatting(new Dog("wangcai",3));
        eatting(new Animal("ren",10));
    }



    public static Animal fuc2(){
        return new Dog("wangcai",3);
    }
    public static void main4(String[] args) {

    }


    public static void fuc(Animal animal){

    }

    public static void main3(String[] args) {
        Dog dog = new Dog("wangcai",2);
        fuc(dog);
    }





    public static void main2(String[] args) {
        Animal animal = new Dog("wangcai",2);
        animal.eat();
    }




    public static void main1(String[] args) {
        final int a = 10;
        Dog dog = new Dog("wangcai",2);
        dog.eat();
        Cat cat = new Cat("miumiu",3);
        cat.eat();
    }
}
